package net.wangxl;

import net.wangxl.config.My;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.context.support.WebApplicationContextUtils;

@SpringBootApplication
@PropertySource("classpath:/config/app.properties")
public class SpringbootApplication implements ApplicationRunner {

    /**
     * SpringApplication可以用来配置spring启动时设置；
     *
     */
    public static void main(String[] args) {
        SpringApplication.run(SpringbootApplication.class, args);
    }

    @Autowired
    My my;

    @Override
    public void run(ApplicationArguments args) throws Exception {

        System.out.println(my);
    }
}

